package com.example.beidouapplication;

//import static com.example.beidouapplication.Menu.Buf_Com3;
//import static com.example.beidouapplication.Menu.Num_DWR;
//import static com.example.beidouapplication.Menu.dx;
//import static com.example.beidouapplication.Menu.dy;
//import static com.example.beidouapplication.Menu.lh;
//import static com.example.beidouapplication.Menu.lhr;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import android.app.Fragment;
import android.widget.Button;

import androidx.annotation.Nullable;

import com.example.beidouapplication.viewmodel.Key;
import com.example.beidouapplication.viewmodel.KeyEvent;

public class FragmentXunbei extends Fragment {

    static FragmentXunbei instance = new FragmentXunbei();

    Button btn_xunbei_row1;
    Button btn_xunbei_row2;
    Button btn_xunbei_row3;

    @Override
    public View onCreateView(
            LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState
    ) {

        View inflate = inflater.inflate(R.layout.fragment_xunbei, container, false);
        return inflate;
    }


    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        btn_xunbei_row1 = (Button) getActivity().findViewById(R.id.btn_xunbei_row1);
        btn_xunbei_row2 = (Button) getActivity().findViewById(R.id.btn_xunbei_row2);
        btn_xunbei_row3 = (Button) getActivity().findViewById(R.id.btn_xunbei_row3);

        btn_xunbei_row1.setOnClickListener(v -> Menu.keyQueue.add(new KeyEvent(Key.ENTER, 1)));
        btn_xunbei_row2.setOnClickListener(v -> Menu.keyQueue.add(new KeyEvent(Key.ENTER, 2)));
        btn_xunbei_row3.setOnClickListener(v -> Menu.keyQueue.add(new KeyEvent(Key.ENTER, 3)));



    }

}